<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Sitepagereview
 * @copyright  Copyright 2010-2011 BigStep Technologies Pvt. Ltd.
 * @license    http://www.socialengineaddons.com/license/
 * @version    $Id: index.tpl 2011-05-05 9:40:21Z SocialEngineAddOns $
 * @author     SocialEngineAddOns
 */
?>
<?php
	$this->headLink()
        ->prependStylesheet($this->seaddonsBaseUrl() . '/application/modules/Sitepage/externals/styles/sitepage-tooltip.css');
?>
<ul class="sitepage_sidebar_list">
	<li class="sitepagereview_show_tooltip_wrapper">
		<div class="sitepagereview_show_tooltip">
			<img src="./application/modules/Sitepage/externals/images/tooltip_arrow.png" alt="" class="arrow" />
			<?php echo Engine_Api::_()->sitepagereview()->truncateText($this->reviewOfDay->body, 100) ?>
		</div>
		<?php $user = Engine_Api::_()->getItem('user', $this->reviewOfDay->owner_id); ?>
		<?php echo $this->htmlLink($user->getHref(), $this->itemPhoto($user, 'thumb.icon')) ?>
		<div class="sitepage_sidebar_list_info">
			<div class="sitepage_sidebar_list_title">
				<?php
					$truncation_limit = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepagereview.truncation.limit', 13);
					$review_title = Engine_Api::_()->sitepagereview()->truncateText($this->reviewOfDay->title, $truncation_limit);
				?>
				<?php echo $this->htmlLink($this->reviewOfDay->getHref(), $review_title, array('title' => $this->reviewOfDay->title)) ?>
	
			</div>

			<?php $page = Engine_Api::_()->sitepagereview()->getLinkedPage($this->reviewOfDay->review_id); ?>

			<div class="sitepage_sidebar_list_details">
			  <?php
			  echo $this->translate('By %1$s', $this->htmlLink($user->getHref(), $user->getTitle()));
			  ?>
			</div>

			<div class="sitepage_sidebar_list_details">
				<?php echo $this->translate("On ").$this->htmlLink(Engine_Api::_()->sitepage()->getHref($page->page_id, $page->owner_id), Engine_Api::_()->sitepage()->truncation($page->title), array('title' => $page->title)); ?>
			</div>
			<div class='sitepage_sidebar_list_details'>
				<span title="<?php echo $page->rating . $this->translate(' rating'); ?>">
					<?php if (($page->rating > 0)): ?>
						<?php for ($x = 1; $x <= $page->rating; $x++): ?>
							<span class="rating_star_generic rating_star"></span>
						<?php endfor; ?>
						<?php if ((round($page->rating) - $page->rating) > 0): ?>
							<span class="rating_star_generic rating_star_half"></span>
						<?php endif; ?>
					<?php endif; ?>
				</span>
			</div>  
		</div>
	</li>
</ul>